/*
 * Copyright (c) 2015 Minshenglife. All rights reserved.
 * Minshenglife PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 */
package com.sentry.web;

import com.sentry.utils.RestReturnData;

import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;

/**
 * @author WuBo (wub1@minshenglife.com)
 *
 */
public class RestControllerSupport {

    
    @ExceptionHandler(Exception.class)
    public RestReturnData<String> handleException(HttpServletRequest req, Exception exception){
        RestReturnData<String> r = new RestReturnData<>();
        r.setCode(500);
        r.setMsg(exception.getMessage());
        return r;
    }
    

}
